package com.foogui.faw.oa.domain;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;


/**
 * 审核实体（用于记录和传递信息）
 *
 * @author wangxin213
 * @date 2024/01/21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("audit_approve")
public class AuditApproveDO implements Serializable {


    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 业务主键字段名
     */
    @TableField("biz_id_field")
    private String bizIdField;
    /**
     * 业务主键
     */
    @TableField("biz_id")
    private String bizId;

    /**
     * 角色工作台待办code
     */
    @TableField("task_instance_code")
    private String taskInstanceCode;


    /**
     * OA流程id
     */
    @TableField("process_instance_id")
    private String processInstanceId;

    /**
     * 申请类型
     */
    @TableField("apply_type")
    private String applyType;



    /**
     * 审批状态（提交，一审，二审，终审，驳回）
     */
    @TableField("finish_status")
    private Integer finishStatus;

    /**
     * 流程结束时间
     */
    @TableField(value = "complete_time")
    private Date completeTime;


    /**
     * 提交人域账号
     */
    @TableField("submit_code")
    private String submitCode;


    public static AuditApproveDO initiate(String bizIdField,String bizId,String submitCode,String applyType){
        AuditApproveDO auditApproveDO = new AuditApproveDO();
        auditApproveDO.setBizIdField(bizIdField);
        auditApproveDO.setBizId(bizId);
        auditApproveDO.setApplyType(applyType);
        auditApproveDO.setFinishStatus(0);
        auditApproveDO.setSubmitCode(submitCode);
        return auditApproveDO;
    }

}
